package net.optix.ip.vo
{
	import mx.collections.ArrayCollection;
	
	public class TrackVO
	{
		public var firmID:int;
		public var firmName:String;
		public var actionType:int;
		public var inventionType:int;
		public var actionCost:Number;
		public var inventionID:int;
		
		public var inventionName:String;
		public var actionTypes:String;
		public var inventionTypes:String;
		
		public static function purseTracks(tracks:XML):ArrayCollection
		{
			var arr:ArrayCollection	=	new ArrayCollection();
			for(var i:int=0; i<tracks.Data.length(); i++)
			{
				var track:TrackVO	=	new TrackVO();
				track.firmID	=	tracks.Data[i].FirmID;
				track.firmName	=	tracks.Data[i].FirmName;
				track.actionType=	tracks.Data[i].ActionType;
				track.actionCost=	tracks.Data[i].ActionCost;
				track.inventionType=tracks.Data[i].InventionType;
				track.inventionID=	tracks.Data[i].InventionID;
				
				track.inventionName	=	tracks.Data[i].InventionName;
				track.inventionTypes=	InventionVO.inventionStatus[track.inventionType];
				switch(track.actionType)
				{
					case 2:
						track.actionTypes	=	"Filing";
						break;
					case 3:
						track.actionTypes	=	"Office Action";
						break;
					case 5:
						track.actionTypes	=	"Office Responses";
						break;
				}
				
				switch(track.inventionType)
				{
					case 9:
						track.inventionTypes	=	"Issued";
						break;
					case 10:
						track.inventionTypes	=	"Abandoned";
						break;
				}
				arr.addItem(track);
			}
			
			return arr;
		}
	}
}